﻿using System;

namespace CSW.Framework.Common.Exceptions
{
    /// <summary>
    /// Exception details.
    /// </summary>
    public class ExceptionDetails
    {
        private readonly string m_ShortExceptionMessage;
        private readonly string m_LongExceptionMessage;
        private readonly Exception m_Exception;
        private readonly bool m_OccurredDuringStartup;

        /// <summary>
        /// Initializes a new instance of the <see cref="ExceptionDetails"/> class.
        /// </summary>
        /// <param name="exception">The exception.</param>
        /// <param name="shortExceptionMessage">The short exception message.</param>
        /// <param name="longExceptionMessage">The long exception message.</param>
        /// <param name="occurredDuringStartup">if set to <c>true</c> the exception occurred during startup.</param>
        public ExceptionDetails(Exception exception, string shortExceptionMessage, string longExceptionMessage, bool occurredDuringStartup)
        {
            m_ShortExceptionMessage = shortExceptionMessage;
            m_LongExceptionMessage = longExceptionMessage;
            m_Exception = exception;
            m_OccurredDuringStartup = occurredDuringStartup;
        }

        /// <summary>
        /// Gets the short exception message.
        /// </summary>
        /// <value>The short exception message.</value>
        public string ShortExceptionMessage { get { return m_ShortExceptionMessage; } }

        /// <summary>
        /// Gets the long exception message.
        /// </summary>
        /// <value>The long exception message.</value>
        public string LongExceptionMessage { get { return m_LongExceptionMessage; } }

        /// <summary>
        /// Gets the exception.
        /// </summary>
        /// <value>The exception.</value>
        public Exception Exception { get { return m_Exception; } }

        /// <summary>
        /// Gets a value indicating whether the exception occurred during startup.
        /// </summary>
        /// <value><c>true</c> if the exception occurred during startup; otherwise, <c>false</c>.</value>
        public bool OccurredDuringStartup { get { return m_OccurredDuringStartup; } }
    }
}
